package groupb6.shopsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import groupb6.shopsystem.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    /**
     * 通过账户名获取用户
     * @param account
     * @return
     */
    @Select("select * from tb_user where account = #{account}")
    User getUserByAccount(String account);

    /**
     * 通过用户id获取信息
     * @param id
     * @return
     */
    @Select("select * from tb_user where id = #{id}")
    User getUserById(Integer id);
}
